package org.ecshop.controllers;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.ecshop.models.GoodsDesc;

import will.icecoffe.core.DataAccessException;
import will.icecoffe.core.SimpleDataAccessService;

import com.opensymphony.xwork2.ModelDriven;



public class GoodsDescController implements ModelDriven<Object> {

	private GoodsDesc goods;
	
	private int id;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	
	@Resource(name="DAS")
	private SimpleDataAccessService<GoodsDesc> das;

	public String show() throws DataAccessException {
		this.goods = das.find("hql", "findGoodsDescById", id).get(0); 
		return "show";
	}
	
	@Override
	public Object getModel() {
		return goods;
	}

}
